﻿///////////////////////////////////////////////////////////////////////////////
// File Name: EditSkin.cpp 
// Purpose: EditSkin.h 实现文件
// Author: 张东斌、ChongyangLee
// E_Mail: malutianshi7905@sina.com; ChongyangLee@hotmail.com
// History: 
// 
///////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "editskin.h"

IMPLEMENT_SERIAL(CEditSkin,CObjectSkin,1)


CEditSkin::CEditSkin(const char* szName)
:CObjectSkin(szName,keEditSkin)
{
	m_fontEdit = GetDefaultFont();
	m_bAutoFont = TRUE;
	m_colorBack = GetSysColor(COLOR_BTNFACE);
}
CEditSkin::~CEditSkin(void)
{
}

const TCHAR * CEditSkin::GetDefaultSkinName()
{
	static const TCHAR NAME[] = _T("Edit");
	return NAME;
}

void CEditSkin::Serialize(CArchive &ar)
{
	CObjectSkin::Serialize(ar);
	if(ar.IsStoring())
	{
		ar.Write(&m_fontEdit,sizeof(m_fontEdit));
		ar.Write(&m_bAutoFont,sizeof(m_bAutoFont));
		ar.Write(&m_imageBorder,sizeof(m_imageBorder));
		ar.Write(&m_textEffect,sizeof(m_textEffect));
		ar.Write(&m_colorBack,sizeof(m_colorBack));
	}
	else
	{
		ar.Read(&m_fontEdit,sizeof(m_fontEdit));
		ar.Read(&m_bAutoFont,sizeof(m_bAutoFont));
		ar.Read(&m_imageBorder,sizeof(m_imageBorder));
		ar.Read(&m_textEffect,sizeof(m_textEffect));
		ar.Read(&m_colorBack,sizeof(m_colorBack));
	}
}
